package com.fanqwz.kotlinmvvm.domain.usecase

import com.fanqwz.kotlinmvvm.domain.`object`.User
import com.fanqwz.kotlinmvvm.domain.executor.PostExecutionThread
import com.fanqwz.kotlinmvvm.domain.executor.ThreadExecutor
import com.fanqwz.kotlinmvvm.domain.repo.UserRepository
import io.reactivex.Flowable
import javax.inject.Inject

/**
 * Created by fanqwz on 2018/3/1.
 */

data class LoginParam(val name:String, val passwd:String)

class LoginUseCase @Inject constructor(private val userRepository: UserRepository)
    : IUseCase<Flowable<User>, LoginParam>{
    override fun execute(arg: LoginParam): Flowable<User> {
        return userRepository.login(arg.name, arg.passwd)
    }
}